/*
 * $Id: RuntimeConfigurationModel.java 42 2013-04-17 15:33:59Z gabakyan $
 * $Author: gabakyan $
 * $Revision: 42 $
 * $Date: 2013-04-17 15:33:59 +0000 (Wed, 17 Apr 2013) $
 *
 * Copyright (c) 2013 Supply Chain Intelligence (SCI), Inc.
 * http://www.scintelligence.com/, Email: info@scintelligence.com
 * All rights reserved.
 *
 * This file is part of Logistics Map.
 *
 * Logistics Map is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * Logistics Map is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Logistics Map.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.sci.logisticsmap.data.model;

import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * The Runtime configuration model.
 *
 * @author gabakyan@gmail.com (Last modified by $Author: gabakyan $)
 * @version $Revision: 42 $
 */
@SuppressWarnings("unused")
@Document(collection="runtimeConfiguration")
public class RuntimeConfigurationModel implements Serializable {
    /**
     * The serial version id.
     */
    private static final long serialVersionUID = 1L;

    /**
     * The id.
     */
    @Id
    private String id;
    /**
     * The locked down runtime option.
     */
    private boolean lockedDown;
    /**
     * The approval only mode runtime option.
     */
    private boolean approvalOnlyMode;
    /**
     * The invitation mode runtime option.
     */
    private boolean invitationMode;
    /**
     * The primary location import template runtime option.
     */
	@DBRef
    private LocationImportTemplateModel primaryLocationImportTemplate;
    /**
     * The allowed country codes runtime option.
     */
    private String[] allowedCountryCodes;

    /**
     * The default constructor.
     * Creates a new Runtime configuration model.
     */
    public RuntimeConfigurationModel() {
    }

    /**
     * The persistence constructor.
     * Creates a new Runtime configuration model.
     *
     * @param lockedDown The locked down runtime option.
     * @param approvalOnlyMode The approval only mode runtime option.
     * @param invitationMode The invitation mode runtime option.
     * @param primaryLocationImportTemplate The primary location import template runtime option.
     * @param allowedCountryCodes The allowed country codes runtime option.
     */
    @PersistenceConstructor
    public RuntimeConfigurationModel(boolean lockedDown, boolean approvalOnlyMode, boolean invitationMode,
                                LocationImportTemplateModel primaryLocationImportTemplate, String[] allowedCountryCodes) {
        this.lockedDown = lockedDown;
        this.approvalOnlyMode = approvalOnlyMode;
        this.invitationMode = invitationMode;
        this.primaryLocationImportTemplate = primaryLocationImportTemplate;
        this.allowedCountryCodes = allowedCountryCodes;
    }

    /**
     * Gets the id.
     *
     * @return The id.
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the id.
     *
     * @param id The id.
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * Gets the locked down runtime option.
     *
     * @return The locked down runtime option.
     */
    public boolean isLockedDown() {
        return lockedDown;
    }

    /**
     * Sets the locked down runtime option.
     *
     * @param lockedDown The locked down runtime option.
     */
    public void setLockedDown(boolean lockedDown) {
        this.lockedDown = lockedDown;
    }

    /**
     * Gets the approval only mode runtime option.
     *
     * @return The approval only mode runtime option.
     */
    public boolean isApprovalOnlyMode() {
        return approvalOnlyMode;
    }

    /**
     * Sets the approval only mode runtime option.
     *
     * @param approvalOnlyMode The approval only mode runtime option.
     */
    public void setApprovalOnlyMode(boolean approvalOnlyMode) {
        this.approvalOnlyMode = approvalOnlyMode;
    }

    /**
     * Gets the invitation mode runtime option.
     *
     * @return The invitation mode runtime option.
     */
    public boolean isInvitationMode() {
        return invitationMode;
    }

    /**
     * Sets the invitation mode runtime option.
     *
     * @param invitationMode The invitation mode runtime option.
     */
    public void setInvitationMode(boolean invitationMode) {
        this.invitationMode = invitationMode;
    }

    /**
     * Gets the primary location import template runtime option.
     *
     * @return The primary location import template runtime option.
     */
    public LocationImportTemplateModel getPrimaryLocationImportTemplate() {
        return primaryLocationImportTemplate;
    }

    /**
     * Sets the primary location import template runtime option.
     *
     * @param primaryLocationImportTemplate The primary location import template runtime option.
     */
    public void setPrimaryLocationImportTemplate(LocationImportTemplateModel primaryLocationImportTemplate) {
        this.primaryLocationImportTemplate = primaryLocationImportTemplate;
    }

    /**
     * Gets the allowed country codes runtime option.
     *
     * @return The allowed country codes runtime option.
     */
    public String[] getAllowedCountryCodes() {
        return allowedCountryCodes;
    }

    /**
     * Sets the allowed country codes runtime option.
     *
     * @param allowedCountryCodes The allowed country codes runtime option.
     */
    public void setAllowedCountryCodes(String[] allowedCountryCodes) {
        this.allowedCountryCodes = allowedCountryCodes;
    }
}
